<?php include THEMES_PATH . 'public/before_body2.phtml';?>
<link href="/statics/front/css/cart.css" rel="stylesheet">
<style>
.order-success td {text-align:center;}
.order-success .order-info {width: 375px;}
.order-info li {list-style: initial;margin: 1em 0;}
.order-info em {font-style:normal;display:inline-block;width:130px;}
</style>
</head>
<body>
<?php include THEMES_PATH . 'public/header2.phtml';?>
<div class="main-width mt2x mb5x align-center order-success">
  <h2 class="align-center title"><?php echo L('Order_Placed');?></h2>
  <h3 class="align-center title"><?php echo L('order_successfully');?></h3>
  <?php if (isset($orderInfo)): ?>
  <ul class="auto align-left mt2x mb2x order-info">
    <li><em class="text"><?php echo L('ordersn');?>:</em> <strong class="text-bold"><?php echo isset($orderInfo['order_sn'])? $orderInfo['order_sn'] : null;?></strong></li>
   <?php if($orderInfo['class_id']!=1){?>
    <li><em class="text"><?php echo L('shippingmethod');?>:</em> <strong class="text-bold"><?php echo isset($orderInfo['shipping_method_name'])? $orderInfo['shipping_method_name'] : null;?></strong></li>
   <?php }?>
    <li><em class="text"><?php echo L('payment_method');?>:</em> <strong class="text-bold"><?php echo isset($orderInfo['payment_method_name']) ? $orderInfo['payment_method_name'] : null;?></strong></li>
    <li><em class="text"><?php echo L('Order_Creation_Time');?>:</em> <strong class="text-bold"><?php echo isset($orderInfo['start_time'])? date('Y-m-d H:i:s',$orderInfo['start_time']) : null;?></strong></li>
      <?php if($orderInfo['class_id']==1){?>
          <li><em class="text">支付费用:</em> <strong class="text-bold"><?php echo isset($orderInfo['pay_amount']) ? "￥".$orderInfo['pay_amount'] : null?></strong></li>
      <?php }else{?>
          <li><em class="text"><?php echo L('goods_amount_total');?>:</em> <strong class="text-bold"><?php echo isset($orderInfo['pay_amount']) ? "￥".$orderInfo['pay_amount'] : null?></strong></li>
     <?php }?>
  </ul>
  <?php if($orderInfo['payment_status'] == OrderModel::PAY_PAYED) :?>
  <table>
    <tr>
      <td><?php echo L('use_balance_all_payed');?></td>
    </tr>
    <tr>
      <td><a href="<?php if(!UserModel::logged()): echo url('order/query',array('order_sn'=>$orderInfo['order_sn']));else: $m = ($user['is_partner'] == 1) ? 'partner' : 'user';echo url($m.'/order_info',array('oid'=>$orderInfo['id']));endif?>"><?php echo L('orderdetailed');?></a></td>
    </tr>
    <?php endif;?>
    <tr>
      <td><?php echo isset($orderInfo['payment']['descripton']) ? $orderInfo['payment']['descripton'] : null;?></td>
    </tr>
    <?php if($orderInfo['payment_status'] == OrderModel::PAY_UNPAYED && $orderInfo['is_gift_orders']!=1 && $no_pay!=1) :?>
    <tr>
      <td class="referral">
        <?php
          echo isset($paymentSubmit) ? $paymentSubmit : null;
        ?>
        <p class="mt1x tips"><?php echo L('payment_gateway');?> <span id="time">10 <?php echo L('_second_')?>s</span>...</p>
        <script>
        var times = 10;//剩余时间,单位秒
        var timeDiv = document.getElementById("time");
        var timeObj = null;
        function timer() {
          if (times == 0) {
            //倒计时结束，提交表单
            document.getElementById("frm").submit();
            window.clearInterval(timeObj);
            return;
          }
          var times_ = times%60 ;
          var t = times_+" <?php echo L('_second_')?>";
          t += times_ > 1 ? 's' : '';
          timeDiv.innerHTML = t;
          times --;
        }
        timeObj = window.setInterval(timer,1000);
        </script>
      </td>
    </tr>
    <?php endif;?>
  </table>
  <?php endif;?>
</div>
<?php include THEMES_PATH.'public/footer2.phtml';?>

<!-- Google Code for &#29983;&#25104;&#35746;&#21333; Conversion Page -->
<script type="text/javascript">
/* <![CDATA[ */
var google_conversion_id = 975966254;
var google_conversion_language = "en";
var google_conversion_format = "3";
var google_conversion_color = "ffffff";
var google_conversion_label = "fLW-CKC41lcQrqCw0QM";
var google_conversion_value = <?php echo $payOrderInfo['pay_amount'];?>;
var google_conversion_currency = "<?php echo $payOrderInfo['currency'];?>";
var google_remarketing_only = false;
/* ]]> */
</script>
<script type="text/javascript" src="//www.googleadservices.com/pagead/conversion.js">
</script>
<noscript>
<div style="display:inline;">
<img height="1" width="1" style="border-style:none;" alt="" src="//www.googleadservices.com/pagead/conversion/975966254/?value=<?php echo $payOrderInfo['pay_amount'];?>&amp;currency_code=<?php echo $payOrderInfo['currency'];?>&amp;label=fLW-CKC41lcQrqCw0QM&amp;guid=ON&amp;script=0"/>
</div>
</noscript>

<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-49088472-1']);
_gaq.push(['_trackPageview']);
_gaq.push(['_addTrans',
  <?php if (!empty($paymentSubmit) && !empty($orderInfo)) {?>
'<?php echo $orderInfo['order_sn'];?>',
'ownonly.com',
'<?php echo $orderInfo['order_amount'];?>',
'0.0',
'<?php echo $orderInfo['shipping_fee'];?>',

'<?php echo $orderInfo['delivery_city'];?>',

'<?php echo $orderInfo['delivery_province'];?>',

'<?php echo $orderInfo['delivery_country'];?>'
]);
 <?php if (!empty($order_items_info)) {?>
<?php foreach($order_items_info as $v){?>
_gaq.push(['_addItem',
'<?php echo $orderInfo['order_sn'];?>',
'<?php echo $v['product_sn'];?>',
'<?php echo $v['product_name'];?>',
'<?php echo $v['category_name'];?>',
'<?php echo $v['pay_price'];?>',
'<?php echo $v['qty'];?>'
]);
<?php }?>
<?php }?>
<?php }?>
_gaq.push(['_trackTrans']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + 'stats.g.doubleclick.net/dc.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-52702113-1']);
_gaq.push(['_trackPageview']);
_gaq.push(['_addTrans',
  <?php if (!empty($paymentSubmit) && !empty($orderInfo)) {?>
'<?php echo $orderInfo['order_sn'];?>',
'ownonly.com',
'<?php echo $orderInfo['order_amount'];?>',
'0.0',
'<?php echo $orderInfo['shipping_fee'];?>',

'<?php echo $orderInfo['delivery_city'];?>',

'<?php echo $orderInfo['delivery_province'];?>',

'<?php echo $orderInfo['delivery_country'];?>'
]);
 <?php if (!empty($order_items_info)) {?>
<?php foreach($order_items_info as $v){?>
_gaq.push(['_addItem',
'<?php echo $orderInfo['order_sn'];?>',
'<?php echo $v['product_sn'];?>',
'<?php echo $v['product_name'];?>',
'<?php echo $v['category_name'];?>',
'<?php echo $v['pay_price'];?>',
'<?php echo $v['qty'];?>'
]);
<?php }?>
<?php }?>
<?php }?>
_gaq.push(['_trackTrans']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + 'stats.g.doubleclick.net/dc.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
<script>(function(w,d,t,r,u){var f,n,i;w[u]=w[u]||[],f=function(){var o={ti:"4011218"};o.q=w[u],w[u]=new UET(o),w[u].push("pageLoad")},n=d.createElement(t),n.src=r,n.async=1,n.onload=n.onreadystatechange=function(){var s=this.readyState;s&&s!=="loaded"&&s!=="complete"||(f(),n.onload=n.onreadystatechange=null)},i=d.getElementsByTagName(t)[0],i.parentNode.insertBefore(n,i)})(window,document,"script","//bat.bing.com/bat.js","uetq");</script>

<?php include THEMES_PATH.'public/after_body.phtml';?>